Skip to content

fix: make FIP-0115 activation height configurable#6830

Merged
LesnyRumcajs merged 1 commit intomainfrom
add-fip0115-env
Mar 31, 2026
Merged

fix: make FIP-0115 activation height configurable#6830
LesnyRumcajs merged 1 commit intomainfrom
add-fip0115-env

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Mar 31, 2026

Summary of changes

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features

    • Added configurability for FIP-0115 base fee activation via the FOREST_FEES_FIP0115HEIGHT environment variable (integer, default -1 to disable). Users can set the epoch for FIP-0115 activation; it will not auto-activate on the next network upgrade.
  • Documentation

    • Updated environment variables reference with FOREST_FEES_FIP0115HEIGHT details (type, default, example, and behavior).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 24b70ce1-17d8-48ea-a48b-f585fd0b3e4d

📥 Commits

Reviewing files that changed from the base of the PR and between 443a849 and 54a9c3c.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/docs/users/reference/env_variables.md
  • src/chain/store/base_fee.rs
  • src/chain_sync/tipset_syncer.rs
  • src/message_pool/msgpool/provider.rs
  • src/rpc/methods/miner.rs
💤 Files with no reviewable changes (1)
  • src/rpc/methods/miner.rs
✅ Files skipped from review due to trivial changes (2)
  • docs/docs/users/reference/env_variables.md
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/message_pool/msgpool/provider.rs

Walkthrough

Refactors FIP-0115 activation to be environment-configurable via FOREST_FEES_FIP0115HEIGHT. compute_base_fee signature loses the xxx_height parameter and now reads activation internally; all callers are updated. Documentation and changelog entries added.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md, docs/docs/users/reference/env_variables.md
Added changelog entry and new env var FOREST_FEES_FIP0115HEIGHT (integer, default -1, controls FIP-0115 activation epoch, testing-only/consensus-breaking).
Base Fee Computation Logic
src/chain/store/base_fee.rs
Introduce global FIP0115_HEIGHT from env; remove xxx_height parameter from compute_base_fee; activation checked internally; updated unit test for new signature.
Call Sites
src/chain_sync/tipset_syncer.rs, src/message_pool/msgpool/provider.rs, src/rpc/methods/miner.rs
Updated calls to compute_base_fee to remove Height::Xxx / xxx_height argument and pass only existing parameters (e.g., smoke_height).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • implement FIP-0115 #6686: Implements configurable FIP-0115 activation and refactors compute_base_fee to read FIP0115 height internally — directly related to this PR's changes.

Possibly related PRs

Suggested reviewers

  • akaladarshi
  • hanabi1224
  • wjmelements
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making FIP-0115 activation height configurable via environment variable, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-fip0115-env
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch add-fip0115-env

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
docs/docs/users/reference/env_variables.md (1)

67-67: Consider adding a Lotus-interop note for operators.

Optional: mention the Lotus equivalent (LOTUS_FEES_FIP0115HEIGHT) to reduce migration confusion in mixed deployments.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/users/reference/env_variables.md` at line 67, Add a brief
Lotus-interop note alongside the FOREST_FEES_FIP0115HEIGHT entry clarifying the
equivalent Lotus environment variable LOTUS_FEES_FIP0115HEIGHT so operators
migrating or running mixed deployments understand the mapping; update the table
cell or a short footnote to mention "Lotus equivalent: LOTUS_FEES_FIP0115HEIGHT"
and indicate it has the same semantics (integer epoch, -1 to disable,
consensus-breaking/testing only).
src/chain/store/base_fee.rs (1)

20-21: Add explicit runtime warning when the consensus override is enabled.

FOREST_FEES_FIP0115HEIGHT is consensus-breaking, but activation is currently silent. A one-time warning here would reduce operator misconfiguration risk.

🔧 Suggested change
 use std::sync::LazyLock;
+use tracing::warn;

 static FIP0115_HEIGHT: LazyLock<ChainEpoch> =
-    LazyLock::new(|| env_or_default("FOREST_FEES_FIP0115HEIGHT", -1));
+    LazyLock::new(|| {
+        let height = env_or_default("FOREST_FEES_FIP0115HEIGHT", -1);
+        if height >= 0 {
+            warn!(
+                "FOREST_FEES_FIP0115HEIGHT={} enabled; this is consensus-breaking and intended for testing only",
+                height
+            );
+        }
+        height
+    });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/chain/store/base_fee.rs` around lines 20 - 21, FIP0115_HEIGHT is being
set silently from env_or_default("FOREST_FEES_FIP0115HEIGHT", -1); change the
LazyLock initialization so that when the resolved value is not the default (-1)
it emits a one-time runtime warning (e.g., via log::warn! or the project logger)
informing operators that a consensus override is enabled and which epoch value
is set; keep the value semantics the same but ensure the warning happens inside
the LazyLock::new closure for FIP0115_HEIGHT so it runs once at startup when the
env var is active.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/docs/users/reference/env_variables.md`:
- Line 67: Add a brief Lotus-interop note alongside the
FOREST_FEES_FIP0115HEIGHT entry clarifying the equivalent Lotus environment
variable LOTUS_FEES_FIP0115HEIGHT so operators migrating or running mixed
deployments understand the mapping; update the table cell or a short footnote to
mention "Lotus equivalent: LOTUS_FEES_FIP0115HEIGHT" and indicate it has the
same semantics (integer epoch, -1 to disable, consensus-breaking/testing only).

In `@src/chain/store/base_fee.rs`:
- Around line 20-21: FIP0115_HEIGHT is being set silently from
env_or_default("FOREST_FEES_FIP0115HEIGHT", -1); change the LazyLock
initialization so that when the resolved value is not the default (-1) it emits
a one-time runtime warning (e.g., via log::warn! or the project logger)
informing operators that a consensus override is enabled and which epoch value
is set; keep the value semantics the same but ensure the warning happens inside
the LazyLock::new closure for FIP0115_HEIGHT so it runs once at startup when the
env var is active.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 710e2507-13d3-46e2-9c46-450acde26cd9

📥 Commits

Reviewing files that changed from the base of the PR and between 0b7f2b4 and 443a849.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/docs/users/reference/env_variables.md
  • src/chain/store/base_fee.rs
  • src/chain_sync/tipset_syncer.rs
  • src/message_pool/msgpool/provider.rs
  • src/rpc/methods/miner.rs
💤 Files with no reviewable changes (1)
  • src/rpc/methods/miner.rs

Comment thread src/chain/store/base_fee.rs Outdated
@akaladarshi
Copy link
Copy Markdown
Collaborator

@LesnyRumcajs Also there is one suggestion by coderabbit, if you think it's worth it:

FOREST_FEES_FIP0115HEIGHT is consensus-breaking, but activation is currently silent. A one-time warning here would reduce operator misconfiguration risk.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Mar 31, 2026
Merged via the queue into main with commit 10c1854 Mar 31, 2026
42 of 43 checks passed
@LesnyRumcajs LesnyRumcajs deleted the add-fip0115-env branch March 31, 2026 16:53
@coderabbitai coderabbitai Bot mentioned this pull request Apr 28, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants